#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <fcntl.h>
int main (){
  int fd;
  char buffer [100];
  fd = open ("random_text.txt", O_RDONLY,0777);
  if(fd < 0){
       printf("error!\n");
       exit(1);}

       int readcount;
       readcount = read(fd,buffer,100);
       /*if(readcount< 0){
       printf("error!\n");
       exit(1);}
       else {
           printf("%.*s\n",readcount,buffer);}*/

           while(readcount>0){
               printf("%.*s\n",readcount,buffer);
               readcount = read(fd,buffer,100);
           }
 
       if (close(fd)<0){
           printf("error!\n");
           exit(1);
       }
   return 0 ;